home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #1 / Amiga Plus 1998 #1.iso / demo-versionen / haage&partner / warpup-warpos / source / tools / ibreak.p < prev    next >
Text File  |  1997-09-24  |  3KB  |  93 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.  
  4. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  5. **           All Rights Reserved
  6.  
  7.                 include powerpc/ppcmacros.i
  8.                 include powerpc/powerpc.i
  9.  
  10.                 include powerpc_lib.i
  11.                 include exec_lib.i
  12.                 include dos_lib.i
  13.  
  14.                 xref    _SysBase
  15.                 xref    _DOSBase
  16.                 xref    _PowerPCBase
  17.                 xref    _LinkerDB
  18.                 smalldata
  19.                 executable
  20.                 escapestr
  21.                 version 9
  22.  
  23. start
  24.                 prolog  1024
  25.                 push    r31
  26.                 la      _d1,template
  27.                 la      _d2,Array
  28.                 li      _d3,0
  29.                 RUN68K_XL       _DOSBase,ReadArgs
  30.                 tstw    _d0
  31.                 beq     .close
  32.                 mr      r31,_d0
  33.                 lw      r3,Array
  34.                 tstw    r3
  35.                 beq     .clear
  36.                 lbz     r4,0(r3)
  37.                 li      r5,0
  38.                 cmplwi  r4,"$"
  39.                 bne     .loop
  40.                 addi    r3,r3,1
  41. .loop
  42.                 lbz     r4,0(r3)
  43.                 tstw    r4
  44.                 beq     .done
  45.                 slwi    r5,r5,4
  46.                 cmplwi  r4,"0"
  47.                 blt     .letter
  48.                 cmplwi  r4,"9"
  49.                 ble     .number
  50. .letter
  51.                 bitclr  r4,31-5
  52.                 subi    r4,r4,("A"-10)
  53.                 b       .cont
  54. .number
  55.                 subi    r4,r4,"0"
  56. .cont
  57.                 add     r5,r5,r4
  58.                 addi    r3,r3,1
  59.                 b       .loop
  60. .done
  61.                 sw      r5,Args
  62.                 li      r4,HW_SETIBREAK
  63.                 CALLPOWERPC     SetHardware
  64.                 la      _d1,setbreak
  65.                 la      _d2,Args
  66.                 RUN68K_XL       _DOSBase,VPrintf
  67.                 b       .free
  68. .clear
  69.                 li      r4,HW_CLEARIBREAK
  70.                 CALLPOWERPC     SetHardware
  71.                 la      _d1,clearbreak
  72.                 la      _d2,Args
  73.                 RUN68K_XL       _DOSBase,VPrintf
  74. .free
  75.                 mr      _d1,r31
  76.                 RUN68K_XL       _DOSBase,FreeArgs
  77. .close
  78.                 pop     r31
  79.                 epilog
  80.  
  81.                 section data
  82. template        dc.b    "ADDRESS",0
  83. setbreak        dc.b    "instruction breakpoint set at %08lx\n",0
  84. clearbreak      dc.b    "instruction breakpoint cleared\n",0
  85.  
  86.                 section bss
  87.                 ds.b    32
  88. Array           ds.l    1
  89. Address         ds.l    1
  90. Args            ds.l    1
  91.                 ds.b    32
  92.                 even
  93.